﻿Imports VBParser

Namespace Compiler
    Public NotInheritable Class SemanticError
        Private ReadOnly m_type As SemanticErrorType
        Private ReadOnly m_span As Span
        Private ReadOnly m_data As Object()

        Public ReadOnly Property Span() As Span
            Get
                Return m_span
            End Get
        End Property

        Public ReadOnly Property Type() As SemanticErrorType
            Get
                Return m_type
            End Get
        End Property

        Public Sub New(ByVal type As SemanticErrorType, ByVal span As Span, ByVal ParamArray data() As Object)
            m_type = type
            m_span = span
            m_data = data
        End Sub
    End Class

    Public Enum SemanticErrorType
        TypeDefinitionConflict
        TypeParameterRedefined
        TypeReferenceConflict
        ''' <summary>
        ''' Can't find the type definition
        ''' </summary>
        TypeResolveFailure
        ''' <summary>
        ''' Find multiple matches of a type name
        ''' </summary>
        TypeResolveAmbiguity
    End Enum
End Namespace